<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
	</head>
	<style>
		.star{
			display: flex;
			padding: 0;
		}
		.star li{
			list-style: none;
			margin-right: 5px;
		}
		.star img{
			width: 20px;
		}
	</style>
	<body>
		<div id='app'>
			<ul class="star">
				<li v-for='i in 5' @mouseenter="hoverIdx=i" @mouseleave="hoverIdx=rate" @click="rate=i">
					<img v-if="i<=hoverIdx" src="../img/star.png" alt="">
					<img v-else src="../img/star-off.png" alt="">
					
				</li>
			</ul>
			{{hoverIdx}}{{rate}}
		</div>
		<script>
			Vue.createApp({
				data(){
					return{
						hoverIdx:2,
						rate:0
					}
				}
			}).mount('#app')
		</script>
	</body>
</html>